From: Jürgen Hötzel Date: Mon, 7 Jan 2013 19:44:48 +0000 (+0100) Subject: * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~3615^2~1129 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=62bcf6709991d2c5dda92dc931e308f7e040c123;p=emacs.git * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): Handle filename correctly, when parsing "source -> target" symlink output. (tramp-adb-handle-set-file-times): New defun. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b890a7e0ed..ac7401aba56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-01-07 Jürgen Hötzel + + * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): + Handle filename correctly, when parsing "source -> target" symlink + output. + (tramp-adb-handle-set-file-times): New defun. + 2013-01-07 Stefan Monnier * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index c6aec52bd07..f5aadd591d6 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -123,7 +123,7 @@ (vc-registered . ignore) ;no vc control files on Android devices (write-region . tramp-adb-handle-write-region) (set-file-modes . tramp-adb-handle-set-file-modes) - (set-file-times . ignore) + (set-file-times . tramp-adb-handle-set-file-times) (copy-file . tramp-adb-handle-copy-file) (rename-file . tramp-adb-handle-rename-file) (process-file . tramp-adb-handle-process-file) @@ -311,7 +311,9 @@ pass to the OPERATION." (and is-symlink (cadr (split-string name "\\( -> \\|\n\\)"))))) (push (list - name + (if is-symlink + (car (split-string name "\\( -> \\|\n\\)")) + name) (or is-dir symlink-target) 1 ;link-count ;; no way to handle numeric ids in Androids ash @@ -615,6 +617,19 @@ But handle the case, if the \"test\" command is not available." v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) "Error while changing file's mode %s" filename))) +(defun tramp-adb-handle-set-file-times (filename &optional time) + "Like `set-file-times' for Tramp files." + (with-parsed-tramp-file-name filename nil + (tramp-flush-file-property v localname) + (let ((time (if (or (null time) (equal time '(0 0))) + (current-time) + time))) + (tramp-adb-command-exit-status + ;; use shell arithmetic because of Emacs integer size limit + v (format "touch -t $(( %d * 65536 + %d )) %s" + (car time) (cadr time) + (tramp-shell-quote-argument localname)))))) + (defun tramp-adb-handle-copy-file (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes)